<h1><%= title "#{@trait.name}" %></h1>

<p>
  <b>Category:</b>
  <%= @trait.category_name %>
</p>

<p>
  <b>Description:</b>
  <%=h @trait.description %>
</p>

<p>
  <b>Icon:</b>
  <%=h @trait.icon %>
</p>

<div id="effects">
	<%= render :partial => 'trait_effects', :locals => {:trait_effects => @trait.trait_effects, :trait => @trait} %>
</div>
<% if is_admin? %>
<h3>Add an attribute effect to this trait</h3>
<p style="color: red"><%= flash[:error] %></p>
<% remote_form_for [@trait, @effect] do |f| -%>
  <p>
  	<select name="trait_effect[character_attribute]">
  		<%= options_trait_attributes %>
  	</select>
  	with modifier <%= f.text_field :modifier, :size => 9 %>
  </p>
  <%= f.submit 'Add this effect' %>
<% end -%>
<h3>Add a special effect to this trait</h3>
<p style="color: red"><%= flash[:error] %></p>
<% remote_form_for [@trait, @effect] do |f| -%>
  <p>
  	<select name="trait_effect[special_case]">
  		<%= options_trait_special %>
  	</select>
  </p>
  <%= f.submit 'Add this effect' %>
<% end -%>
<% end %>
<% if is_admin? %>
<%= link_to 'Edit', edit_trait_path(@trait) %> |
<%= link_to 'Back', traits_path %> |
<% end %>

<%= link_to 'Home', '/' %>
